<template>
  <div class="kingkongarea">
    <!-- 默认导航 -->
    <section v-if="!datas.imageList || !datas.imageList[0]" class="defaultNavigation">
      <!-- 导航 -->
      <div v-for="index in 5" :key="index" class="navigationList">
        <!-- 图片 -->
        <img
          src="../../../assets/images/imgs.png"
          alt="默认图片"
          draggable="false"
          :style="{ 'border-radius': datas.borderRadius + '%' }"
        />
        <!-- 文字 -->
        <p :style="{ color: datas.textColor, 'font-size': datas.textSize + 'px' }">导航</p>
      </div>
    </section>

    <!-- 导航列表 -->
    <section v-else class="defaultNavigation">
      <!-- 导航 -->
      <div v-for="(item, index) in datas.imageList" :key="index" class="navigationList">
        <!-- 图片 -->
        <img :src="item.src" alt="默认图片" draggable="false" :style="{ 'border-radius': datas.borderRadius + '%' }" />
        <!-- 文字 -->
        <p :style="{ color: datas.textColor, 'font-size': datas.textSize + 'px' }"> {{ item.text }} </p>
      </div>
    </section>

    <!-- 删除组件 -->
    <slot name="deles" />
  </div>
</template>

<script>
export default {
  name: "Kingkongarea",
  props: {
    datas: Object,
  },
  created() {
    console.log(this.datas, "--------kingkongarea");
  },
};
</script>

<style scoped lang="scss">
.kingkongarea {
  position: relative;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  /* 默认导航 */
  .defaultNavigation {
    // overflow-x: scroll;
    justify-content: space-evenly;
    display: flex;
    flex-wrap: wrap;
    background: #fff;
    margin: 10px 14px;
    border-radius: 8px;
    justify-content: flex-start;
    /* 导航 */
    .navigationList {
      // display: flex;
      // flex-direction: column;
      // align-items: center;
      width: 20%;
      text-align: center;
      img {
        margin-top: 5px;
        width: 45px;
        height: 45px;
      }
      p {
        font-size: 12px;
        margin-top: 5px;
        width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: center;
        box-sizing: border-box;
      }
    }
  }
}
</style>
